package com.tutu.swagger.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * @Program: SpringBoot
 * @Description:
 * @Author: JK.TuTu
 * @Create: 2022-11-04 21:52
 **/
@RestController
@Api(tags = "用户相关api")  //类上的注解 控制整个类生成接口信息的内容
public class Demo01Controller {

    @ApiOperation(value = "根据id查询用户")  //方法的说明 value值必须提供
    @GetMapping("getTest/{id}")
    public Integer getTest(@ApiParam(name = "id", required = true) @PathVariable("id") Integer id) {
        return id;
    }

    @PostMapping("postTest")
    public String postTest() {
        return "postTest";
    }


    @PutMapping("putTest")
    public String putTest() {
        return "putTest";
    }

    @DeleteMapping("deleteTest")
    public String deleteTest() {
        return "deleteTest";
    }


}
